home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 07 - 1991 / 07.08 Aug 91 / Browser sources / CBrowserDoc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-01-19  |  2.1 KB  |  59 lines  |  [TEXT/KAHL]

  1. /******************************************************/
  2. /*                                                                                                      */
  3. /*    CBrowserDoc.h                                                                          */
  4. /*                                                                                                      */
  5. /*    Classes for Browser documents                                          */
  6. /*                                                                                                      */
  7. /*    Written in Think C version 4.0.2                                  */
  8. /*    Based on CStarterDoc.h                                                        */
  9. /*                                                                                                      */
  10. /*    Allen Stenger    January 1991                                              */
  11. /*                                                                                                      */
  12. /******************************************************/
  13.  
  14. #define    _H_CBrowserDoc
  15. #include <CDocument.h>
  16. #include <CApplication.h>
  17.  
  18. struct CBrowserDoc : CDocument {
  19.  
  20.     /* instance variables */
  21.     
  22.     /* **itsDataH and **itsLineStartsH are shared with     */
  23.     /* CBrowserPane, which uses them to update the           */
  24.     /* window contents and to control scrolling                 */
  25.     char         **itsDataH;        /* handle to itsFile's data     */
  26.     short        itsLineCt;    
  27.         /* number of lines in **itsDataH                                    */
  28.     long        **itsLineStartsH;    
  29.         /* Handle to line starts table - defined by                */
  30.         /*      (*itsLineStartsH)[i] =                                            */
  31.         /*            offset to start of line i                                    */
  32.         /* for i=0 to i=itsLineCt-1, and as the size of     */
  33.         /* **itsDataH for i=itsLineCt (or 1 if no data)        */                    
  34.     long        itsFindOffset;
  35.         /* offset of last found instance of search string    */
  36.         /* in **itsDataH, or -1 if none                                     */
  37.  
  38.     /* Methods - same function as CStarterDoc, except     */
  39.     /* as noted                                                                                 */
  40.     
  41.   void        IBrowserDoc(CApplication *aSupervisor, 
  42.                       Boolean printable);
  43.   void        Dispose(void);
  44.   void         FindIt(long offset);
  45.         /* Internal function to find next occurence of         */
  46.         /* string. Search begins "offset" into the text.     */
  47.         /* If found, the window is scrolled to put the         */
  48.         /* found line at the top, and itsFindOffset is         */
  49.         /* updated to the offset to the found substring.    */
  50.     void        DoCommand(long theCommand);
  51.         /* DoCommand processes the Search menu                         */
  52.   void        UpdateMenus(void);
  53.       /* UpdateMenus processes the Search menu  - Find    */
  54.       /* is always enabled, and Find Again is enabled     */
  55.       /* if a search string has been entered in Find         */
  56.     void        OpenFile(SFReply *macSFReply);
  57.     void        BuildWindow(Handle theData);
  58. };
  59.